package com.heima.search.utils;


import com.heima.model.common.user.entity.ApUser;

public class AppUserThreadLocalUtil {

    private final static ThreadLocal<ApUser> TL = new ThreadLocal<>();

    /**
     * 添加用户
     * @param
     */
    public static void  setUser(ApUser apUser){
        TL.set(apUser);
    }

    /**
     * 获取用户
     */
    public static ApUser getUser(){
        return TL.get();
    }

    /**
     * 清理用户
     */
    public static void clear(){
        TL.remove();
    }
}